Trying to work out query matching scores