refactored the count up method