add const qualifiers where necessary