Updated the script to add and remove numbers to a queue