Cleaned up generateMove