It would help if our flip function used the correct iterator