Modified to pass integration testing.