Added better commenting.
Removed unused cachemiss variable.
Added configurable tablename var.