Moved event to listener; Fixed formatting issues.