finished protocol parser