Modified evaluation function