added repairing R method