Deleting Objects in a proper way. Minor improvements added.