Rewrite waiting list code