Getting the switch cells to work properly