added arg for flip