add ticket.h and some gc code