implement some more bits of the protocol, not tested yet