more cleanup
fixed encoding stuff