test_ratio function added along with methods.