change readline() to read()
using read char by char