cleanup, added some comments