add Caclulate function