runs loop and responds