cleaned up Queue functions
updated tests and documentation