implimented flip