start of workning smart pointer