efficiency increase and bug removal

when number of maximum possible spaces to draw fruit are found the loop
stops