added normalization and saving of numpy arrays