better case matching

This should work better.