changed isIrrational method