generalized GSS so that it can either shrink or expand the step size depending on outcome