Changed out the code for the obstruction detection