did most of the optimization exercises