Destructor fixed, added test for constructor and destructor and successfully tested with valgrind