socket mostly parameterized, but needs some tweaks