added pass by reference and const