looped input of pointers