fix bug and add avg similarity features.