another rewrite in go with windows support in mind