Some cleanup, better comments.