Finished generating tables; fixed table reading