updates queue and tests to fix peek problem. Also adds docstrings