Write expectiminimax algorithm