added const prefix for some arguments.