updated code to pass all test. need to finish destructor and special cases