Updates range function to return an array (instead of an unpacked array)