support Windows is added, code is optimized