more engine rewrite