Designing an engine from scratch