added todos and optimized getMoves