Updated master code to reflect new protocol structure.