winCheck function