rem: while (tmp->next && tmp->next->msec < handler->msec) {
add: while (tmp->next && IS_AFTER(handler->when, tmp->next->when)) {
context: WMAddTimerHandler(int milliseconds, WMCallback *callback, void *cdata){    TimerHandler *handler, *tmp;        handler = malloc(sizeof(TimerHandler));    if (!handler)      return NULL;        handler->msec = rightNow()+milliseconds;    handler->callback = callback;    handler->clientData = cdata;    /* insert callback in queue, sorted by time left */    if (!timerHandler || timerHandler->msec >= handler->msec) {	/* first in the queue */	handler->next = timerHandler;	timerHandler = handler;    } else {	tmp = timerHandler;	while (tmp->next && tmp->next->msec < handler->msec) {	    tmp = tmp->next;	}	handler->next = tmp->next;	tmp->next = handler;    }    return handler;}