implemented length of a list