Added input grid.
Updated table handling.