Added distributed support and fixed a few bugs in the generational and pathfinding algorithm