Give names to table; little fixes and restructuring.