clean up getLength