local engine layer, working version