Merge pull request #5 from kyoushuu/master

query: Port from JavaScript to Python
grilo: Port from JavaScript to Python