added impl and test of length method
further impl