Checked and corrected syntax (thanks to JSHint) and added a minified js