Simplified implementation of `words`
Polished source code