Adding queue functionality