Add the length to the data returned
Since we compute it anyway, better return it along with the result