cleaned up some code

pass the jslint test