merged into perl script