numpy array implementation