Trying out my logic for an automatic progress bar