Corrected the decimal errors by being more accurate in calculations