fixed broken smoothDownsample function