needs so much work
dumb mistake, if is now elif
added safety state at beginning of loop, super reduntant
it compiles! needs to be tested on hardware