Adapted for cuboid analysis, some other features added (confmat, entropy)