updated emmiter code fixed bugs