Table set up, inital calculation code.