Method is too long and code for bouncing the line of detection could be moved into a new method. Some renamings would be nice as well.