use pass-by-reference instead of a pointer