optimized order for memory