added flipping