modified:   getremains.pl