Add cost comparison function