adding in event emmitter and tests