refactored len method, tests working again