Rewritten huge part of engine.