Second ela for IMI: Algorithms and Optimizations