implement garbage collection.