added a functional Queue implementation