Tidy Main file

Fixed some notes from perlcritic
Cleaned up with perltidy