add doc(fixed #8)
stop increment count if it's max number of occurrences