renamed and reordered lines of code