added some stuff for flipping

it is not working noww.... but committed it just in case of the
confliction