Minor changes, added some comments