Base state now in the algebra
ifelse case for the R algorithm