calculation and more set up