Correct with loops and passing more tests.