updated disconnection tracking and added some analysis code