modify ratio in vm and add two functions to get numerator and denominator of rational number