remove unused code and minor tweaks
fixed a bunch of stuff to make comment work