refactoring as per issue #3, using gmpy2 mpz and mpfr number everywhere (still neds review)