Removed unnecessary functions that weren't used.
Removed unused variables and improved the pathfinding by adding 1 instead of doing math.