Updated code to deal with similarity structure file