You're right. I was thinking too much about writing it in a way the beginner would understand, but I think your first suggestion is both efficient and easy to understand.