removes redundant lines