Creating a table using stacks