added deletion of objects at end of main class