Improved perl techniques and removed a bit of left behind debugging code