Performance improvements by using numpy arrays instead of Python lists.