To numpy arrays where appropiate in ex1, also supporting an arbitrary number of features.