Added optimization examples. Closes #2