Has anyone tried working out this one?

How to detect IE4 without wrongly detecting IE5.0 (IE5.0 usually returns a navigator.appVersion of 4.0)

Here's the code im working with using substring of IE version:

Code:
// <head>
<script language="JavaScript">
 this.version = navigator.appVersion;  
</script>
Code:
// <body>
<script language="JavaScript">

if (navigator.appName == "Microsoft Internet Explorer"){
    if (version.substring(0,1) <= 4){
	if (version.substring(22,23) <= 4){
	document.write("This Browser is IE4 or lower!");
 }
        else{
	document.write("This Browser is IE5 or higher!");
  }
 }
}
else{
document.write("This Browser isn't IE!");
}

document.write("<br>This Browser is " +version);
</script>
The version string usually return's something like this:
4.0 (compatible; MSIE 5.0; Windows 98; DigExt)

Can anyone see any problem with using this method?