fixed bug in array.R