Help please to improve this obstacle avoiding robot project.

I gathered that part of the decision making engine from the seventh line of your void loop. It has the robot going straight until something is less than 30 units in distance away.