added flip support