This (whole) function, works on Win XP (tested on VM)