the indentation is wrong here, also there is now and unused int i; at the top of the function that should be removed