renamed calculate histogram to calculate daily need