sclass ImageCategorizer { new L images; float allowedDistance = 0.1f; // allowed difference within category *() {} *(float *allowedDistance) {} int addImage(RGBImage img) { for i over images: if (rgbDistance(images.get(i), img, allowedDistance) <= allowedDistance) ret i; images.add(img); ret l(images)-1; } int numCategories() { ret l(images); } }