fixed print statement in main by changing specifier to %g