Did some of the table calculation stuff, and fixed some other stuff i think.