implemented client server stuff