It makes way more sense to order the operations this way (skips an if)
Added some basic code for the obsacle detector