updated queuelib to 1.0.0, adjusted for idx in foreach