Moved to passing pointers instead of passing by reference.