multistep optimization