stash of the min-max algo