added end game checking
added rotations