fixed future nesting with residual algo