Added deleteold.
Formatting.
Minor optimization.