updated with substring count command