tested to copy back data from the array to host and it's correct