Change pointers to pass by reference