added functionality for winning