cleanup, add some comments