fix readall returns None
add main()
+ reader/gen