making all the calculations at context provider
making all the calculations at context provider