added some javadocs, fixed next() for events