added billing logic