create changePie function;