You dont need value2 array as you are just printing the array from last.