How to map variables from one value to another?