added caching for best moves
added caching for best moves
added perfect player