flesh out trajectory optimization a bit