added functions min-kof, max-kof, kof
(preliminary versions)