Sorting out return of pointers