Added doc commands to queue functions. Minor reorganizing.