Fixed unit test to pass.  Cleaned up code.