changed to work with json lists instead of numpy arrays