added support for flip