Clustering via the modified Petford-Welsh algorithm