Changed some parameters to const references