total_items implementation