adding emit functions to classes