Added input and winning logic