First commit.Added isValidMove and supporting methods