shift an array from a index