More logical way of reading from stdin.