changed cost/score calculation for pathfinding