removing redundant lines