Changed cout to printf