function p.payload()
    --Making sure if have enough gold.
    local gold = ga_get_i("xar.player.gold.amount")
    if( gold < 5 ) then
        game_msg.add("Not enough gold for telekinesis")
        return
    end
    --Will apply telekinesis.
    --Technically there is an explot if the player's
    --gold is between 5 and 9 inclusive and they are doing
    --a pickup that costs 10 gold, but who cares.

    ga_play_sound("telekinesis")

    local gold_before = ga_get_i("xar.player.gold.amount")
    local num_picked_up = p.main_helper()
    local gold_after = ga_get_i("xar.player.gold.amount")
    local gold_diff = gold_after - gold_before

    local gold_only_cost = 0
    if    ( gold_diff < 40  ) then gold_only_cost = 5
    elseif( gold_diff < 80  ) then gold_only_cost = 6
    elseif( gold_diff < 120 ) then gold_only_cost = 7
    elseif( gold_diff < 160 ) then gold_only_cost = 8
    elseif( gold_diff < 200 ) then gold_only_cost = 9
    else                           gold_only_cost = 10
    end
    --
    local count_only_cost = 0
    if    ( num_picked_up < 5  ) then count_only_cost = 5
    elseif( num_picked_up < 10 ) then count_only_cost = 6
    elseif( num_picked_up < 15 ) then count_only_cost = 7
    elseif( num_picked_up < 20 ) then count_only_cost = 8
    elseif( num_picked_up < 25 ) then count_only_cost = 9
    else                              count_only_cost = 10
    end

    local final_cost = math.max(gold_only_cost, count_only_cost)
    local gold_after_pay = gold_after - final_cost
    if( gold_after_pay < 0 ) then gold_after_pay = 0 end --In case of exploit.

    --Actually paying the gold.
    ga_set_i("xar.player.gold.amount", gold_after_pay)

    --Testing.
    -- game_msg.add("Telekinesis: num_picked_up = " .. tostring(num_picked_up))
    -- game_msg.add("Telekinesis: gold_only_cost = " .. tostring(gold_only_cost))
    -- game_msg.add("Telekinesis: count_only_cost = " .. tostring(count_only_cost))
    -- game_msg.add("Telekinesis: final_cost = " .. tostring(final_cost))
end

--New way.
function p.main_helper()
    local count = 0 --How many bents were picked up.

    local level = ga_get_viewer_level()
    local lp = ga_get_viewer_offset()
    -- local radius = 16.0 --Important.
    local radius = 24.0 --Important.
    local ents = ga_bent_sphere_query(level, lp, radius) --MORE!!!
    for k,v in pairs(ents) do
        local dist = v.dist
        local bp = v.bp

        --Checking for visibility.
        local block_center = std.block_center(bp)
        local visible = ga_vis_test_level(level, lp, block_center)

        if( visible ) then
            --Calling telekinesis.
            local type = ga_bent_get_type(level, bp)
            local mod_name = type
            local func_name = "on_telekinesis"
            if( std.mod_func_exists(mod_name, func_name) ) then
                --The BEnt DOES have a on_telekinesis function.
                _G[mod_name][func_name](level,bp)
            end
            --Seeing if picked it up.
            local bent_type_after = ga_bent_get_type(level, bp)
            if( bent_type_after == "" ) then count = count + 1 end
        end
    end
    return count
end
