Moved a comment block to its proper place, made a msgrcv call safer, queue deletions now checked for errors, added comments
Updated sample run