added functionality for swapping btw modes