Functionally added (NEEDS CHECKING)

added functionality to flip class