sorting mechanism added to words model