thread and line counter