Cleanup, added some comments