win checking and handling works! but was unable to find an elegant method
currently ~100 lines of code