added constructor and destructor