Rewrite of the enten4 engine