Deleting unnecessary lines