Basic logic for p4 implemented