moved calculations to different class