learn how to use $.each and tweak encoding