The code print the original array twice. The code works just fine under main methods, but it fail when it runs under reverseArray method