trying to solve valarray pointer access problem, enhancing documentation