Fix problem with paths
Add changes to make the index more ameanable
Add work for paths logic