Improved check_win module