rewrite the NoLibra computing function