added curry function