put the connect function back in it's own file