added comments to connectionhandler.js detailing what is going on