renamed engine.  Cleaned up poorly written code by book author