Added some comments to the Engine class.
Cleaned up the code using Eclipse.