added in some logic to prefer first word of query, which is likely a name