fixes to arduino code