added a deep delete and changed output