Reading lines implementes. Fixing bugs - infinite loop while reading files.