I think I see your problem. Basically, once the bot checks to the right and finds a path, it goes into a new forward method. But when it finishes, it still has to deal with the original method. Also, the bot will turn left when it reaches a dead end no matter what, which may be bad. I would suggest having a "checkLeft()" method.