repair2 function removed, repair() now overloaded