tested similar code on linux & windows--works!