finished beautiful queue implementation