Updated sandbox code to include maximize opt.