initial connect code made

first code for making connection