fixed bug with numpy error in similarity matrix, minor changes