seems to be mostly done for negotiating connections. need to test and tweak. #78.