Your test here isn't quite right, the 5th element is a 3, rather than an 5. I'm surprised you didn't see this when you ran your tests.