cleaned up the Arduino code