completed program for new task - however trajectory data does not work yet