calculations now working