Wrote message parsing code