deleted unused stuff, rearranged, addded comments