coding p4 output