starting to replace pointers with reference variables