curry function  (is this still necessary?)