Added loop code that works! :D
Merged working loop code into master
Added some comments