can we not use named return values here? it does make the code in the function harder to follow.