Added 'emit' method, improved variable names, removed unused method 'filter', updated JSDocs, added unit tests to the new method