Implementing a weak version of A* pathing algorithm.