Use fold() in remaining_len()