changed working directory and sum(bins[i:j])