updated length function