Use readline instead of reading 1 byte