spliced some stuff for an arduino verison