implement basic gc