function dist = make_prob_table(dist)

%ensuring probabillity sum to one 
total_prob = trapz(dist.t,dist.p);
dist.p = dist.p/total_prob; 

% interpolates the date one minute scale
inter_p.t = 0:1/60:24;
inter_p.p = zeros(length(inter_p.t),1);
for i = 1:length(inter_p.t)
    inter_p.p(i) = interp1(dist.t,dist.p,inter_p.t(i));
end
% calulating the probability minute by minute
% descrete probabillity
inter_p.P = zeros(length(inter_p.t)-1,1);
for i = 1:length(inter_p.t)-1
    inter_p.P(i) = trapz(inter_p.t(i:i+1),inter_p.p(i:i+1));
end

dist.prob_table.p = cumsum(inter_p.P);
dist.prob_table.t = inter_p.t;

end
