changed the least-squares method from all entries to single queries - query = key