Accessing arrays using range