clean up the code
fix encoding problem