Fixed the integration function that it will repeat on a subsequent call. This may not be good behavior in general, but it serves the current purposes.