Added winning condition and replay functionality