rearranged things, created the heuristic search