The "earth" acceptance test fails, because of an off-by-one error here. The check should be `i <= end` instead of `i < end`.