added function and perltidy