Improve setVariables to support multiple variables. Implement tests