added opt course examples, and added gradient calculation of more than one output when using the wrapper