Better counter, style fixes