Table build function created