Fixed the flipping stuff