js cleanup

removed unneeded code
added some comments