added connection code, still figure out termination
still timing out