Add file with routine for flipping mode and reg