define function createTable