Added more table logic and formatting stuff in general