implemented index, query history, auto correction