Change trajectory.js to add docstrings