Fixes to depletion()
More changes to depletion() and added testing.