dim finds smallest box containing white