who wrote how to mend a broken heart