updated to handle patchlevels without breaking things too horribly. (may not handle all edge cases...probably wont)