simplified flip() significantly