added use of pointers