implemented printing synonyms in a separate method