modified to output html tables