fixed directory structure and rewrote for index analysis