I was planning to refactor the inner loop too but I wanted to get the test to pass first. Thanks for the code snippet!