Replaced scant() with getchar(), for discarding inputs from buffer.