some logic for billing