pathfinding algorithim implemented, with bugs.