using pointer instead of copy