use std::unique_ptr and RAII
update .gitignore