Added queueLength function