Added code to implement the engine tools

Redone a lot of the comments.
Added W versions
Fixed a few small bugs