Very bare bones implementation of differential dynamic programming