change args from pass by value to pass by const reference