use func instead of printf