v0.50 Using stepsbetweensamples to make optimization block more robust