added const modifiers where applicable