Improved string analysis