fix any bugs; add info emission to file