reworking evaluation function