added runall, set quantum, and global quantum var.