implemented basic version of setVariable