program index remove last lines