Enhanced engine code.

Closes #21