refactored code so the decrement ends at 5 instead of zero