ported smushamt (untested)