Please have a look on my code and help me finding out the bug

start the loop from i=1;