First version of smooth. Crashes on large images