Hmm ... seems to take two queues, one of which had better be pristine (or, at least, empty) and makes this reference the other's contents.  You should probably say that: the short-hand you've used doubtless conveys all that information to you, who already know that's what the function does, but it doesn't convey it to the newcomer, who doesn't already know what the text is saying.
Also: meaning of the int returned ?