Added listener code as well as Logger

What is this doing here?