fixed issue #7 and started work on encoding issues