finished the bulk of the connection initialization routine