changed auto_ptr to unique_ptr
removed not used variables
changed a order of member initializers in a member initializer list in the definition of the constructor