Replace puts with printf