Final Commit for week 1

added the nested loop and arranged the code to make sence