fixed the algorithm - now it will always work when the progress bar is flat
tiny bit of cleanup
Merge pull request #8 from CraftOfClans/ProgressBarFix

fixed the algorithm - now it will always work with a flat bar