changed fprintf to printf