Added curry and uncurry functions