homework4_4:replace raw pointer with smart pointer