Tidied up the script with perltidy