cleanup. add some comments.