Indented, changed JS file name, Optimized check()