Edited method to tables generation.