Script which generates tables