Fixed requires references, and added parantheses around range expressions for clarity.