polished code and fixed progress display (was very jerky at the end of a sync)