update comments and no more unneeded copying output bytes