some changes to printf and bugfixes