Losing condition refined

Added sufficent counter to handle the number of empty fields. Programm
doesnt crash if the field gets full.