fixed bug in pathfinding, still needs work, added cursor lock