Changed variable name in function