move calculations to init