munge ending code