function [agentIdx, trajIdx] = covertIdxForm(absIdx, Tj)

agentIdx = zeros(size(absIdx));
trajIdx = zeros(size(absIdx));
for i=1:length(absIdx)
    absIdxTemp = absIdx(i);
    count = 1;
    if absIdxTemp > Tj
        while absIdxTemp > Tj
            absIdxTemp = absIdxTemp - Tj;
            count = count + 1;
        end
    end
    
    trajIdx(i) = absIdxTemp;
    agentIdx(i) = count;
end

% agentIdx = floor((absIdx)./(Tj)); % how many traj size steps are we?
% trajIdx = absIdx - (agentIdx-1).*Tj;
% % agentIdx = agentIdx + 1; % must account for indexing by zero
end