Pass by reference, why did I make such a stupid error