Optimized code with Idea.