add much faster version; each word sorted only once