added table calculation