nearly done with wire protocol implementation