Need to be careful: numpy arrays need to be copy()ed otherwise they're passed by reference