added curried version
added curried version