imported patch smaug2.diff