Improved loops analysis
Added instant repaint