debug mass function