order_count function