avoided counting repeat matches to query hashes; added --wavdir option