added code to count number of orthogonal dogs per board