centering an array and increasing the values of elements in both directions