Added comments to drawTable to make it easier to understand