updated for Arduino 1.5.8 support