Added function that creates and returns and ndarray.