a lot of bugs fixes
modify heuristics for sorting moves