Wrote the constructor and destructor