Fixing some comment formatting and using the range to return the value rather than index.