refactor code to use more than one table for one page; add inverse function; reorganize index.html