update comments
use c++11

- replace auto_ptr with unique_ptr
- use shared_ptr