completed for loops

completed for loops