cleaned up code according to jslint