Added max option
This should work
This might work..

Changes direction to backwards if range < 20 cm