added rudimentary trajectory recording option and flow