updated length conversion