Add countValidPositions