Modified to satisfy unit tests.