modified to compare exatch integers : parseInt, update queue length when shrinking queue