fixed counter array algo