Copyright (c) 2015 - 2021 by Michael Dinkelaker
     portions of the code by Grant Drake
