update top words code