added some comments
added event redirection support