Some work on client. Still incomplete