Added variable option for specifying the mappings for swapping forward and backward.