changed to 1d arrays.