added implementation of immutable queue