Refactoring - runLinear() in linearSim

Moved the conditional from inside the for loop of runLinear to outside
the for loop as it was only occurring on the first iteration anyway.