Alex - were you aware of another of Erland's excellent articles which discusses just this problem (in a good deal of detail)?
http://www.sommarskog.se/dyn-search.html
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.