adding queue functionality and tests