implemented evaluation function