initialize traj in state space and some tweaks
small tweaks