fixed bug related to connection id mapping and cleaned up some code mostly commented out code. Sorry if I removed anything needed.