function WORdirtAndBloodMain(player)
    --print("Logger: running WORdirtAndBloodMain function")

    -- Dirtiness Sandbox
    local dirtinessMechanic = SandboxVars.WashOrRot.EnableDirtinessMechanic
    --print("dirtinessMechanic: " .. tostring(dirtinessMechanic))
    local dirtinessIncreaseDecreaseRateUntilEffects = SandboxVars.WashOrRot.DirtinessIncreaseDecreaseRateUntilEffects

    -- Bloodiness Sandbox
    local bloodinessMechanic = SandboxVars.WashOrRot.EnableBloodinessMechanic
    --print("bloodinessMechanic: " .. tostring(bloodinessMechanic))
    local bloodinessIncreaseDecreaseRateUntilEffects = SandboxVars.WashOrRot.BloodinessIncreaseDecreaseRateUntilEffects
    
    -- Get the player's worn items
    local wornItems = player:getWornItems()
    -- Get the player's body parts
    local visual = player:getHumanVisual()
    local bodyPartCount = BloodBodyPartType.MAX:index()

    if dirtinessMechanic then
        --print("Logger: dirtinessMechanic is true")
        local overallBodyDirtiness = WORincreaseBodyDirtinessByClothingDirtiness(player, wornItems, visual, bodyPartCount)
        --print("overallBodyDirtiness: " .. overallBodyDirtiness)
        WORhandleDirtinessTimeUntilEffects(player, overallBodyDirtiness, dirtinessIncreaseDecreaseRateUntilEffects)
    end
    
    if bloodinessMechanic then
        --print("Logger: bloodinessMechanic is true")
        local overallBodyBloodiness = WORincreaseBodyBloodinessByClothingBloodiness(player, wornItems, visual, bodyPartCount)
        --print("overallBodyBloodiness: " .. overallBodyBloodiness)
        WORhandleBloodinessTimeUntilEffects(player, overallBodyBloodiness, bloodinessIncreaseDecreaseRateUntilEffects)
    end
    
    player:resetModelNextFrame()
end

function WORdirtAndBloodEffects(player)
    --print("Logger: running WORdirtAndBloodEffects function")

    -- Itching Sandbox 
    local itchingMechanic = SandboxVars.WashOrRot.EnableItchingMechanic
    --print("itchingMechanic: " .. tostring(itchingMechanic))

    -- Sickness Sandbox
    local sicknessMechanic = SandboxVars.WashOrRot.EnableSicknessMechanic
    --print("sicknessMechanic: " .. tostring(sicknessMechanic))

    -- Get the player's stats
    local stats = player:getStats()
    -- Get the player's Grimed Moodle
    local moodle = MF.getMoodle("worgrimed", player:getPlayerNum())
    local moodleLevel = moodle:getLevel()
    --print("moodleLevel: " .. moodleLevel)

    if itchingMechanic == true then
        --print("Logger: itchingMechanic is true")
        WORitching(player, moodleLevel)
    end
    if sicknessMechanic == true then
        --print("Logger: sicknessMechanic is true")
        WORsickness(player, moodleLevel, stats)
    end

end

function WOREveryOneMinuteMain()

    for playerIndex = 0, getNumActivePlayers()-1 do
        local player = getSpecificPlayer(playerIndex)
        
        WORgrimedMoodleUpdate(player)
        WORdirtAndBloodEffects(player)
        
    end
end

function WOREveryTenMinuteMain()

    for playerIndex = 0, getNumActivePlayers()-1 do
        local player = getSpecificPlayer(playerIndex)
        
        WORdirtAndBloodMain(player)
        
    end
end

--[[ function WOREveryHourMain()

    for playerIndex = 0, getNumActivePlayers()-1 do
        local player = getSpecificPlayer(playerIndex)
        
        
    end
end ]]

Events.EveryOneMinute.Add(WOREveryOneMinuteMain)
Events.EveryTenMinutes.Add(WOREveryTenMinuteMain)
--Events.EveryHours.Add(WOREveryHourMain)