improved pod
tidied up encoding guessing functions