Changed: don't modify arguments and better variable naming