Added code for generating location table and per-tag table.