number theoretic algorithms added