added unit tests and destroy() method