Changed ranges to xranges