finished inverse index assignmnet