Add length function for character length