updated "display" code to use shared_ptr