A method of clustering comprising: locating a mark within a document; generating a resized mark image from the bitmap of the mark; retrieving a cluster from existing clusters; comparing an x size and a y size of the mark with an x size and a y size of the cluster; if there is a match of the x size and the y size, comparing an ink percentage of the mark to an ink percentage of the cluster, the ink percentage being a percentage of the number of black pixels to the total number of pixels in the mark; if there is a match of the ink percentage comparing the resized mark image to a resized image of the cluster; if there is a match between the resized mark image and the resized image of the cluster, performing an xor ink match, the xor ink match comprises computing a center of gravity of the bitmap of the mark and center of gravity of the cluster and computing an xor distance between the bitmaps of the mark and the cluster and centered at the center of gravity, wherein there is a match if the xor distance is less than a threshold value; if there is a match for the xor ink match, performing a weighted and-not, WAN, match, the WAN match treating black to white errors separately from white to black errors when calculating weights, wherein there is a match if a WAN distance is less than a threshold value; if there is a match for the WAN match, adding the mark to the cluster; if there is any mismatch for the cluster, obtaining a next cluster from the existing clusters; and if there is any mismatch for the cluster and if there is no next cluster, adding the mark as a new cluster to the existing clusters. locating a mark within a document; generating a resized mark image from the bitmap of the mark; retrieving a cluster from existing clusters; comparing an x size and a y size of the mark with an x size and a y size of the cluster; if there is a match of the x size and the y size, comparing an ink percentage of the mark to an ink percentage of the cluster, the ink percentage being a percentage of the number of black pixels to the total number of pixels in the mark; if there is a match of the ink percentage comparing the resized mark image to a resized image of the cluster; if there is a match between the resized mark image and the resized image of the cluster, performing an xor ink match, the xor ink match comprises computing a center of gravity of the bitmap of the mark and center of gravity of the cluster and computing an xor distance between the bitmaps of the mark and the cluster and centered at the center of gravity, wherein there is a match if the xor distance is less than a threshold value; if there is a match for the xor ink match, performing a weighted and-not, WAN, match, the WAN match treating black to white errors separately from white to black errors when calculating weights, wherein there is a match if a WAN distance is less than a threshold value; if there is a match for the WAN match, adding the mark to the cluster; if there is any mismatch for the cluster, obtaining a next cluster from the existing clusters; and if there is any mismatch for the cluster and if there is no next cluster, adding the mark as a new cluster to the existing clusters.