Updated sketch to be compatible for Arduino IDE 1.0