[ADD]Added a test file and changed code according to jslint