added proper return of line number and occurence in file