adding oncomplete function, clear, and minified script
removing console commands from minified