Minor formatting changes, made readInput independent function