Added note on optimization of logp
Refactoring of functions related to similarity computations and data display.