More functions now use references rather than pointers.