fixed check for correct criteria sums
changes in TODO