added some lines to evaluate() method