added a fix for parts and fixed the output encoding