pnt_names should be passed as a reference of a pointer in this function, if you want to change its original pointer.