Cleaned up shop / added comments. Next commit will switch from identifying similar segments with chainid's to
wordid's.