turn the index dir into an argument.
add shingle.
change the def of confidence
rename properly.