Fix functions.js except I don't know how to curry