cleaned the arduino code somewhat