fixed bug where program crashes when file has no extension
fixed bug in countLines() to now count empty lines correctly