I fixed the bug where input always returned 0.
Just forgot to implement return to read().