Added helper function to check valid squares for queens and rooks. Haven't tested it yet