Implemented termination + garbage collection