Added a line count function