Changing table generation to group items more logically
fixing index page