Added scan feature with match and count options.