replaced some allocations with make_shared
updated example for new relaxed syntax