address comments and fix eof