Updated logic for que and score