Added the posibility to extract just a slice of the arrays