Change main loop in reader cuz of 0 return problem and adjust the parsing to allow 0 input.