createTable() function implemented