moved calculations to seperate class