Queue implementation.