minor changes to perl script