function takes pointer as arg