offcos an algorithm lib