added flipping option