Updated for Windows compatibility