implemented queue data structure (with some help from Steven Skiena)