added logic to calc the ratio