Removed winCheck function, and moved it to its own file.