add support for ratios

fixed division by 0