fixed clone bug, and better AI search algorithm