got all calculations working