refactor heuristic function and add misplace tilts