added textcount and textoutput