removing unnecessary hFlush.
removing toI.
OK now returns values.
using withFile.
better naming.
refactoring.
refactoring.
extracting pure function.
applicative style.
refactoring.
printing "NG".