rewrite of smooth to support x/y arrays -- needs more testing