added functionality for flipping X,
flipping X is done automatically on receiving input from c++