Changed the interface to allow pickling of function
Changed the interface to allow pickling of function