simple implement problem, use C I/O format, even more elegant