a similar function for array views