adding encoding option -- still need to write test to validate