fixed that horrible bug; i need to do more type checking inside functions, passing a system instead of a trajectory was too hard to find