Updated to work in Arduino IDE