I'm open to another implementation. I did it this way because it passes the existing unit tests.