code change for p4 and p6