Added rest var to code