basic logic, but having issues with win