added support for proper comparitor functions