Moves variables inside function