Optimized EndCraft Code