change pointers to references