Fixed a bug that didn't process the last line of the input.
Also, updated comments based on the changes made in README.