only do flipping/permuting when required