think this is a working dfs shifter for a 1D array