Adding queue code