fixed code for calculating intervals; updated results