added new function to check for win