use pointer instead of reference for my own code