Adding weight to shortest path to victory and code cleanup