replaced some code with the text-flip package