updated irrational .cpp