working version with connection to server

working version with connection to server