fixed curry, added docs and fixed tests