updated to work with Arduino 1.0+