tidied full source, minified using uglifyjs