change cout to printf for efficiency