Organization and Comments

Reorganized code and added some comments