implement length function
implement dot function