remove cruft; add comments