length impl but need unit tests