another correct but ugly version of smooth