added add_event.c and get_nextevent.c