first revision of the final arduino code, removed unused arduino code