added initial code to turn a position graph into a motion map