added support for keyword sorting