ref #621 Q.consume

I implemented "Q.consume" function for an issue #621.

Any advice of naming variables and style of coding would be appreciated.