Extending A* to solve multi-agent pathfinding problems with waypoints