adding function altering references passed