updated for flipped reads