changed parameter to be const