added support for number of instances evaluation