Added comments to protocol-facing code