added some comments + fixed some jslint stuff