adds recursive minmax -bugs