Adding length function.