Patients were randomly assigned to undergo total knee replacement followed by 12 weeks of nonsurgical treatment ( total-knee-replacement group ) or to receive only the 12 weeks of nonsurgical treatment ( nonsurgical-treatment group ) , which was delivered by physiotherapists and dietitians and consisted of exercise , education , dietary advice , use of insoles , and pain medication .