moved functions from hazzle.js to funcs.js