Added a counter to track progress