added code comments
fixed utf-8 output