updated Arduino code