Unfinished optimisation of tablecreator.py