added currying function and test.