history-based counter