added more test cases
fixed jshint issues