similarity matrix calculation complete; minus conversion to logs for underflow prevention