(minor tweak to reduce scope of variable 'lines')