Add countChange function implementation