added c++ code for sample based pathfinding