file handle implemented, need to fix bug in missing last line processing