working a little better, tests still failing on encoding