Final changes to optimization tutorial code