Use references to avoid unneeded copying