Added notes and modified range of iteration of for loop