Created end condition and enabled mouse clicking