start calculations for table