add function evaluateResult() and some tiny modified