added more trajectory code