p and q must be bigIntegers to compare them with cmp function