Updated to use same code as the older ShiftBrite "library"