changed pass C by value, to pass by const ref