Sorry, ignore this suggestion - these functions need to be in global scope, so they way you have done it is fine.

The alternative would be to hang each function off `window`, but it's probably ok as is.