made structelement shared_ptr
made map a shared_ptr