Modified the mine counter logic