selfsimilarity lookup table indexes fixed
some bug fixes
tabs and spaces