fixed the algorithm - flat progress bars now generate properly