create curry function