added basic connection code