mostly finished lib, server and one client