a line reader function.

removed an unused library and added comment.