Close #332.  can now be a function