upgraded the Arduino code