replaced many pointers