now using pointers to objects rather than objects