ostream operator, [] operator, destructor