Implemented error check; Added comments to all the files; Cleaned up the JavaScript and CSS code