convert to queue to make parallelizing easier