some rewriting for better index use
unused index entries removed
some code tidying
fixed wrong XPaths; closes #16