Complex heuristic
Changed the way the different steps are performed. Now first perform movements, then merges