Rewrote engine.

Signed-off-by: Pontus <flash13records@gmail.com>