added comments to explain how compact table generation works since it is a little confusing.