modernize rref code