added const to function arguments