rewrote slicearray to use type system information and copyValue functions