fixed clear button

added minified version of script
small performance improvements