added const to buffer parameters in functions