Wrote code for finding running trajectories

Still has a few bugs