it is a little bit weird that this overwrites the argument at the top of the function