Added a free function for queue (untested).
Committing for debugging purposes.