move provide function belowe compute function