Working (i think) endgame check for 4 pcs