New version of parseQuery