Put in some neighbourhood functions and separated out the heuristic method.