Add non-buffered input

I wasn't doing anything in particular and stumbled upon this. I added the non-buffered input, and had a stab at some other parts of the code while I was at it. Cheers!