Added additional restrictions to isValidMove. Created flip method