add ident symbol
change iter to c++ iter
add function scopes
change raw ptr to smart ptrs