Adding protocol and tests
Fixed merge