Some minor changes to the original Adafruit code