What is 3-way matching in AP and why do you need to implement it?