Restored Protocol

Reverted back to the unchanged 317 protocol. It was hell to do but I
think I got all of it. Any problems pls report.