Changed locations of variables in function