can handle flipped edges now