Changes to rupgrade
Attempt at making a function for rupgrade