Separated creating matrix_dict and similarity